@tailwind base;
@tailwind components;
@tailwind utilities;

/* 重置一些基础样式 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: var(--line-height-normal);
  text-rendering: optimizeLegibility;
  transition: background-color var(--transition-normal) var(--transition-timing);
  overflow-x: hidden;
}

/* 基础容器 */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-4);
  padding-right: var(--spacing-4);
  max-width: 1280px;
}

/* 现代按钮样式 */
.btn {
  border-radius: var(--radius-lg);
  padding: var(--spacing-2) var(--spacing-6);
  font-weight: 500;
  transition: all var(--transition-normal) var(--transition-bounce);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: var(--spacing-2);
  outline: none;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
  top: -150%;
  left: -150%;
  opacity: 0;
  transition: all 0.6s var(--transition-timing);
}

.btn:active:after {
  opacity: 0.3;
  top: -50%;
  left: -50%;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 5px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn-secondary {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: var(--color-gray-200);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
  transform: translateY(0);
  background: var(--color-gray-300);
}

.btn-outline {
  background: var(--color-background);
  border: 1px solid var(--color-gray-200);
  color: var(--color-gray-700);
}

.btn-outline:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
  transform: translateY(-2px);
}

.btn-outline:active {
  transform: translateY(0);
  background: var(--color-gray-100);
}

/* 尺寸变体 */
.btn-sm {
  padding: var(--spacing-1) var(--spacing-3);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--spacing-3) var(--spacing-8);
  font-size: var(--font-size-lg);
}

/* 卡片样式 */
.card {
  background: var(--color-background);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all var(--transition-normal) var(--transition-timing);
  border: 1px solid var(--color-gray-100);
  height: 100%;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--color-gray-200);
}

.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

@media (prefers-color-scheme: dark) {
  .card-glass {
    background: rgba(31, 41, 55, 0.7);
    border: 1px solid rgba(55, 65, 81, 0.5);
  }
}

/* 输入框样式 */
.input {
  width: 100%;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-3) var(--spacing-4);
  font-size: var(--font-size-base);
  transition: all var(--transition-fast) var(--transition-timing);
  background-color: var(--color-background);
  color: var(--color-gray-900);
}

.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

.input:disabled {
  background-color: var(--color-gray-100);
  cursor: not-allowed;
  opacity: 0.7;
}

/* 徽章样式 */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-1) var(--spacing-2);
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1;
}

.badge-primary {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

/* 工具类 */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }

.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-accent { background-color: var(--color-accent); }
.bg-success { background-color: var(--color-success); }
.bg-error { background-color: var(--color-error); }
.bg-warning { background-color: var(--color-warning); }

/* 间距工具类 */
.mt-1 { margin-top: var(--spacing-1); }
.mt-2 { margin-top: var(--spacing-2); }
.mt-4 { margin-top: var(--spacing-4); }
.mt-6 { margin-top: var(--spacing-6); }
.mt-8 { margin-top: var(--spacing-8); }

.mb-1 { margin-bottom: var(--spacing-1); }
.mb-2 { margin-bottom: var(--spacing-2); }
.mb-4 { margin-bottom: var(--spacing-4); }
.mb-6 { margin-bottom: var(--spacing-6); }
.mb-8 { margin-bottom: var(--spacing-8); }

/* 布局辅助类 */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-4);
}

/* 动画类 */
.fade-in { animation: fade-in var(--transition-normal) var(--transition-timing) forwards; }
.pulse { animation: pulse 2s infinite; }
.float { animation: float 3s ease-in-out infinite; }
.shimmer {
  background: linear-gradient(90deg, 
    var(--color-gray-100), 
    var(--color-gray-50), 
    var(--color-gray-100));
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* 响应式隐藏/显示 */
@media (max-width: 640px) {
  .hidden-sm { display: none; }
  .block-sm { display: block; }
  .flex-col-sm { flex-direction: column; }
  .text-center-sm { text-align: center; }
  .gap-2-sm { gap: var(--spacing-2); }
}

@media (max-width: 768px) {
  .hidden-md { display: none; }
  .block-md { display: block; }
  .flex-col-md { flex-direction: column; }
  .text-center-md { text-align: center; }
}

/* 毛玻璃效果 */
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(8px); }
.backdrop-blur-lg { backdrop-filter: blur(12px); }

/* 暗色模式适应 */
@media (prefers-color-scheme: dark) {
  .dark-mode-invert { filter: invert(1) hue-rotate(180deg); }
} 